<html>
<head><meta charset="utf-8"><title>Debugging code generation bug (stage0 compiler issues) · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html">Debugging code generation bug (stage0 compiler issues)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226472677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472677">(Feb 16 2021 at 05:09)</a>:</h4>
<p>I introduced a bug and I can't build std anymore. I think I can build core, but I'm not sure. I was thinking stage0 is built with the downloaded compiler and uses the downloaded compiler's core and std and has the bug I introduced, but it seems like I can't pass -Z flags to it, logging is disabled, and most importantly it doesn't support feature flags so I can't test the bug. Is there a way to enable these in stage0 compiler?</p>



<a name="226472754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472754">(Feb 16 2021 at 05:10)</a>:</h4>
<p>I checked <a href="https://rustc-dev-guide.rust-lang.org/compiler-debugging.html">https://rustc-dev-guide.rust-lang.org/compiler-debugging.html</a> but it seems like this kind of scenario is not covered there.</p>



<a name="226472786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472786">(Feb 16 2021 at 05:11)</a>:</h4>
<p><span class="user-mention" data-user-id="119169">@osa1</span> you can use <code>RUSTC_BOOTSTRAP=1</code> to test nightly features on beta</p>



<a name="226472836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472836">(Feb 16 2021 at 05:12)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Awesome!! Thanks!</p>



<a name="226472848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472848">(Feb 16 2021 at 05:12)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> any tips on enabling logging in stage0?</p>



<a name="226472867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472867">(Feb 16 2021 at 05:13)</a>:</h4>
<p>you can use RUSTC_LOG=info, but anything with more granularity is compiled out</p>



<a name="226472902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472902">(Feb 16 2021 at 05:13)</a>:</h4>
<blockquote>
<p>I was thinking stage0 is built with the downloaded compiler and uses the downloaded compiler's core and std and has the bug I introduced, but it seems like I can't pass -Z flags to it, logging is disabled, and most importantly it doesn't support feature flags so I can't test the bug.</p>
</blockquote>
<p>This doesn't sound right. The stage0 compiler <em>is</em> the downloaded compiler. <a href="https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#understanding-stages-of-bootstrap">https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#understanding-stages-of-bootstrap</a></p>



<a name="226472959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472959">(Feb 16 2021 at 05:14)</a>:</h4>
<p>Ah, OK. I think what I refer to is the "bootstrap" compiler, right?</p>



<a name="226472969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472969">(Feb 16 2021 at 05:14)</a>:</h4>
<p>Built with stage0 (downloaded compiler), uses stage0's core and std, and has the code generator bug I introduced.</p>



<a name="226472996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472996">(Feb 16 2021 at 05:15)</a>:</h4>
<p>Hm</p>



<a name="226472999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226472999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226472999">(Feb 16 2021 at 05:15)</a>:</h4>
<p>I'm unsure what you mean. The bootstrap compiler (stage0 compiler) doesn't have your changes, so you can't have introduced a bug to it.</p>



<a name="226473006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473006">(Feb 16 2021 at 05:15)</a>:</h4>
<p>I know, I understand now that stage0 is downloaded</p>



<a name="226473062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473062">(Feb 16 2021 at 05:16)</a>:</h4>
<p>I'm saying there should be a version of the compiler that is built with stage0 and uses stage0's libraries. What is that called and where can I find the path to it?</p>



<a name="226473072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473072">(Feb 16 2021 at 05:16)</a>:</h4>
<p>ah, that's the stage1 compiler. <code>build/$TARGET/stage1/bin/rustc</code></p>



<a name="226473074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473074">(Feb 16 2021 at 05:16)</a>:</h4>
<p>Because that's the earliest stage compiler with the bug I introduced</p>



<a name="226473081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473081">(Feb 16 2021 at 05:16)</a>:</h4>
<p>note that it does <em>not</em> use stage0's libraries, it uses the master version of libstd</p>



<a name="226473090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473090">(Feb 16 2021 at 05:17)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#why-does-only-libstd-use-cfgbootstrap">https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#why-does-only-libstd-use-cfgbootstrap</a></p>



<a name="226473233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473233">(Feb 16 2021 at 05:20)</a>:</h4>
<p>Hmm.. I think I see the problem now. I can't use stage1 compiler because it needs to link the compiled programs with core and std that stage1 itself built. I need to tell it somehow to not link std and core, because I can't build them because of the bug.</p>



<a name="226473253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473253">(Feb 16 2021 at 05:20)</a>:</h4>
<p>you can work around it with <code>#[no_std]</code></p>



<a name="226473258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473258">(Feb 16 2021 at 05:20)</a>:</h4>
<p>if you can't build <code>core</code> you'll have trouble though</p>



<a name="226473281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473281">(Feb 16 2021 at 05:21)</a>:</h4>
<p>Unfortunately I can't build core, yeah</p>



<a name="226473294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473294">(Feb 16 2021 at 05:21)</a>:</h4>
<p>Currently stage1 fails with "error[E0463]: can't find crate for <code>core</code>"</p>



<a name="226473300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473300">(Feb 16 2021 at 05:22)</a>:</h4>
<p>Can I avoid linking core somehow?</p>



<a name="226473344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473344">(Feb 16 2021 at 05:22)</a>:</h4>
<p><code>#![no_core]</code>, but almost nothing compiles without core</p>



<a name="226473363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473363">(Feb 16 2021 at 05:22)</a>:</h4>
<p>Yeah that didn't work.</p>



<a name="226473369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473369">(Feb 16 2021 at 05:23)</a>:</h4>
<p>what are you trying to do btw?</p>



<a name="226473376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473376">(Feb 16 2021 at 05:23)</a>:</h4>
<p>debug the codegen bug?</p>



<a name="226473450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473450">(Feb 16 2021 at 05:24)</a>:</h4>
<p>Yeah</p>



<a name="226473483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473483">(Feb 16 2021 at 05:25)</a>:</h4>
<p>here's a minimal no_core program:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(no_core, lang_items)]</span><span class="w"></span>
<span class="cp">#![no_core]</span><span class="w"></span>
<span class="cp">#![crate_type = </span><span class="s">"lib"</span><span class="cp">]</span><span class="w"></span>

<span class="cp">#[lang = </span><span class="s">"sized"</span><span class="cp">]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="nb">Sized</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="226473690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473690">(Feb 16 2021 at 05:29)</a>:</h4>
<p>I need 'copy', 'clone', 'receiver', ...</p>



<a name="226473701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473701">(Feb 16 2021 at 05:29)</a>:</h4>
<p>I fixed the bug in the meantime, but I feel like I'll need this again.</p>



<a name="226473702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473702">(Feb 16 2021 at 05:29)</a>:</h4>
<p>you can add those with <code>lang = "copy"</code> and so on</p>



<a name="226473761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473761">(Feb 16 2021 at 05:30)</a>:</h4>
<p>Is the lang items documented somewhere? I need right types too otherwise type checker panics.</p>



<a name="226473790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473790">(Feb 16 2021 at 05:30)</a>:</h4>
<p><code>trait Clone {}</code> doesn't work, for example. I need <code>Sized</code> bound (and methods too?)</p>



<a name="226473801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473801">(Feb 16 2021 at 05:31)</a>:</h4>
<p>I don't know, sorry. You can see how it's implemented in libcore.</p>



<a name="226473820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226473820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226473820">(Feb 16 2021 at 05:31)</a>:</h4>
<p>OK thanks.</p>



<a name="226479796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226479796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226479796">(Feb 16 2021 at 07:18)</a>:</h4>
<p><a href="https://github.com/bjorn3/rustc_codegen_cranelift/blob/master/example/mini_core.rs">https://github.com/bjorn3/rustc_codegen_cranelift/blob/master/example/mini_core.rs</a> should help</p>



<a name="226489993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Debugging%20code%20generation%20bug%20%28stage0%20compiler%20issues%29/near/226489993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Debugging.20code.20generation.20bug.20(stage0.20compiler.20issues).html#226489993">(Feb 16 2021 at 09:27)</a>:</h4>
<p>I ended up adding a new codegen option and built std/core without the option. I can now use the option to debug my code gen changes on small examples.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>